<template>
    <div>
      <el-table :data="users" style="width: 100%">
        <el-table-column prop="id" label="ID" align="center"></el-table-column>
        <el-table-column prop="username" label="用户名" align="center"></el-table-column>
        <el-table-column prop="email" label="邮箱" align="center"></el-table-column>
      </el-table>
    </div>
  </template>

<script>
export default {
  data() {
    return {
      users: [],
    };
  },
  created() {
    this.loadUsers();
  },
  methods: {
    async loadUsers() {
      const response = await this.$axios.get('http://localhost:5000/api/users');
      this.users = response.data;
    },
  },
};
</script>

<style scoped>
</style>